package gases.as3.librarys.components.ui.control
{
	import gases.as3.librarys.components.skin.data.BaseSkin;
	import gases.as3.librarys.components.ui.basic.GLabel;

	public class GLabelButton extends GButton
	{
		public function GLabelButton(label:String=null, labelColor:uint=0xFFFFFF,w:Number = 80,h:Number = 25,lableSize:int=12)
		{
			if(label != null)
			{
				_txt = label;
			}
			_color = labelColor;
			_size = lableSize;
			_width = w;
			_height = h;
			super();
		}
		
		override protected function initialization():void
		{
			super.initialization();
			_label = new GLabel(_txt, _color,_size);
			this.addChild(_label);
		}
		
		override public function set skin(value:BaseSkin):void
		{
			super.skin = value;
			setWH(_width,_height);
			_label.x = (background.Gwidth - _label.Gwidth) * 0.5;
			_label.y = (background.Gheight - _label.Gheight) * 0.5;
			
		}
		
		public function set color(value:uint):void
		{
			_color = value;
			_label.color = _color;
		}
		
		public function set size(value:int):void
		{
			_size = value;
			_label.size = _size;
		}
		
		public function set text(value:String):void
		{
			_label.text = value;
		}
		
		override public function dispose():void
		{
			this.removeChild(_label);
			_label.dispose();
			_label = null;
			super.dispose();
		}
		
		private var _color:uint;
		private var _size:int;
		private var _label:GLabel;
		private var _txt:String ="";
		
		private var _width:Number;
		private var _height:Number;

	}
}


